package com.my.cd.decorator.decorator;

import com.my.cd.decorator.Drink;

/**
 * 次分支实现：调料分支
 */
public class Decorator extends Drink {

    private Drink drink;

    public Decorator(Drink drink) {
        this.drink = drink;
    }

    @Override
    public float cost() {
        return super.getPrice() + drink.cost();
    }

    @Override
    public String getDesc() {
        return drink.getDesc() + " && " + super.getDesc();
    }

}
